package win.larryzeal.threadpool;

/**
 * Created by LarryZeal on 2017/9/19.
 */
public class ThreadPoolTest {

    public static void main(String[] args){

        Runnable[] rs = new Runnable[100];
        for(int i = 0; i < rs.length; i++){
            final int tmp = i;
            rs[i] = () -> {
                System.out.println("current index: " + tmp);
            };
        }

        ThreadPoolManager threadPoolManager = ThreadPoolManager.newFixedThreadPool(6);
        threadPoolManager.execute(rs); // 提交任务数组
        threadPoolManager.shutdown(); // 任务执行完毕时，关闭线程池。

        System.out.println("over");
    }

}
